<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/admin.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/main.css'); ?>">

<script language="JavaScript" src="<?php echo $this->_webroot('skin/js/jy.js'); ?>"></script>
<style>
td span {color:red;}
.green {color:green;}
.red {color:red;}
</style>
</head>
<body>
<input type="hidden" id="update_right" value="1" ></input>
<div id="maincontent">
<psp:tags     htmlname='messagebox'  iconname='messagebox' />
	<div class="wrap">
    <div class="crumbs">当前位置 &gt;&gt; 网站管理 &gt;&gt; <a href="">新闻列表</a></div>
        <hr />

<div class="seachbox">
        <div class="content2">
        	<form method="get" name="searchForm" action="<?php echo $this->_url('admin/article/index');?>">
            	<table class="form-table">
	            	<tbody>
	            	<tr>
	                   	<td width="240px">
	                   		<img border="0" alt="SEARCH" src="<?php echo $this->_webroot('skin/images/icon_search.gif'); ?>">
	                   		新闻分类：
	                   		<select name="id">
								<option value="0">请选择新闻分类</option>
								<?php foreach($catlist as $value) { ?>
								<option value="<?php echo $value['articlecat']['id']; ?>" <?php if($cat_id==$value['articlecat']['id']){echo "selected";} ?> ><?php echo $value['articlecat']['cat_name'];?></option>
								<?php } ?>
							</select>
	                   	</td>
	                   	<td><input type="submit" value="搜索" class="regular-button"></td>
	                </tr>
                </tbody>
            </table>
           </form>
        </div>
    </div>		
		
	<div class="infobox">
    <h3><span class="left">新闻分类</span> <span style="margin-right:15px;" class="right"><a style="float:right;" href="<?php echo $this->_url('admin/article/add');?>">添加新闻</a></span></h3>
    <div class="content2">
		<form action="a.php?act=goods_brand_del" name="form1" method="post">
		<table class="list_table" style="font-size:12px;">
		 	<thead>
            <tr style="text-align:center">
				<th width="20px"><input type="checkbox" value="" onclick="checkall(this,'article_id[]');"></th>
				<th width="40px">ID</th>
				<th width="150px" align="left">新闻标题</th>
				<th width="110px" align="left">新闻分类</th>
				<th width="40px">外链</th>
				<th width="300px" align="left">链接地址</th>
				<th width="36px">显示</th>
				<th width="189px">添加时间</th>
				<th width="40px">操作</th>
			</tr>
			</thead>
			<tbody>
			<?php if($result['data']) {
			foreach($result['data'] as $value) {?>
			<tr style="text-align:center">
				<td><input type="checkbox" name="article_id[]" value="<?php echo $value['article']['id'];?>" /></td>
				<td><?php echo $value['article']['id'];?></td>
				<td class="limit" align="left">
					<?php if($value['article']['is_blod'] && $value['article']['tag_color']) { ?>
						<span><a href="m.php?app=news_edit&id=<?php echo $value['article']['id'];?>" style="color:<?php echo $value['article']['tag_color'];?>"><b><?php echo $value['article']['title'];?></b></a></span>
					<?php } else if($value['article']['is_blod']) { ?>
						<span><a href="m.php?app=news_edit&id=<?php echo $value['article']['id'];?>"><b><?php echo $value['article']['title'];?></b></a></span>
					<?php } else if($value['article']['tag_color']) { ?>
						<span><a href="m.php?app=news_edit&id=<?php echo $value['article']['id'];?>" style="color:<?php echo $value['article']['tag_color'];?>"><?php echo $value['article']['title'];?></a></span>
					<?php }else {?>
						<span><a href="m.php?app=news_edit&id=<?php echo $value['article']['id'];?>"><?php echo $value['article']['title'];?></a></span>
					<?php } ?>
				</td>
				<td align="left"><a href="m.php?app=news_list&id=<?php echo $value['article']['cat_id'];?>"><?php echo $catinfo[$value['article']['cat_id']]['cat_name'];?></a></td>
				<?php echo $value['article']['is_link'] ? '<td class="center green">是</td>' : '<td class="center red">否</td>';?>
				<td align="left"><?php echo $value['article']['link_url'];?></td>
				<td>
					<?php if($value['article']['is_show']) { ?>
					<img src="<?php echo $this->_webroot('skin/images/yes.gif'); ?>" onclick="toggle_show(this,'<?php echo $value['article']['id']; ?>')" />
					<?php } else { ?>
					<img src="<?php echo $this->_webroot('skin/images/no.gif'); ?>" onclick="toggle_show(this,'<?php echo $value['article']['id']; ?>')" />
					<?php } ?>
				</td>
				<td><?php echo $value['article']['add_time'];?></td>
				<td>
					<a href="<?php echo $this->_url('admin/article/edit/'.$value['article']['id']);?>">修改</a><br />
					<a href="<?php echo $this->_url('admin/article/del/'.$value['article']['id']);?>" onclick="return confirm('您确定要删除这条消息吗？');">删除</a>
				</td>
			</tr>
			<?php }?>
			<tr>
				<td colspan="9">
					<span class="button-container"><input class="regular-button" type="submit" name=""  onclick="return delcheck();" value="批量删除" /></span>
				</td>
			</tr>
			<?php } else { ?>
			<tr>
				<td colspan="9" class="center">暂无信息!</td>
			</tr>
			<?php } ?>
			<tr>
				<td colspan="9" class="center">
					<a href="<?php echo $result['page']['head'];?>">首页</a> 
                            <a href="<?php echo $result['page']['prevPage'];?>">上一页</a> 
                            <?php foreach($result['page']['plist'] as $k => $v ) { ?>							
                            <a href="<?php echo $v; ?>"><?php echo $k; ?></a>
							<?php } ?>
                            <a href="<?php echo $result['page']['nextPage'];?>">下一页</a> 
                            <a href="<?php echo $result['page']['foot'];?>">尾页</a> 
                            当前第<?php echo $result['page']['current']['num'];?>页/共<?php echo $result['page']['pageCount'];?>页			
				</td>
			</tr>
			
			</tbody>
		</table>
		</form>
	  </div>
	 </div>
	</div>
</div>
<div id="ajaxmessageid" style="color:red; display:none; width:270px; margin:5px auto;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;正在加载数据。。。</div>
<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js'); ?>"></script>
<script language="JavaScript">
<!--
function toggle_show(obj,id) {
	var rights=document.getElementById("show_right").value;
	if(rights != '0'){
		var re = /yes/i;
		var src = obj.src;
		var isshow = 1;
		var sss = src.search(re);
		if(sss &gt; 0) {
			isshow = 0;
		}
		ajax("a.php?act=news_isshow_toggle","POST","id="+id+"&amp;s="+isshow,function(data){
			if(data) {
				obj.src = '../skin/default/images/'+data+'.gif';
			}
		});
	}else{
		ShowMessageBox("对不起，您没有权限不能修改！",'0');
		location.href="m.php?app=error";
	}
}
var inputs = document.getElementsByTagName("input");

function delcheck(){
	var checked = false; 
    for (var i = 0; i &lt; inputs.length; i++) 
    { 
    	if (inputs[i].checked == true) 
        {
            checked = true;
            if(confirm('确定要执行此操作吗？')){
            	break; 
                }else{
                	return false;
                	break; 
                    }
        }  
    } 
    if (!checked) 
    { 
        ShowMessageBox("请至少选择一个标题！",'0'); 
        return false; 
    }
    return true;
}
//-->
</script>
</body>
</html>